package com.zjgsu.demo.nodeEntity;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;

import java.util.List;
@NodeEntity(label="trouble")
public class Trouble {
    @GraphId
    private Long id;
    private String name;
    private String method;
    @Relationship(type = "拥有")
    @JsonProperty("拥有")
    private List<Device> deviceList;

    public void addDeviceToDeviceList(Device device){
        this.deviceList.add(device);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public List<Device> getDeviceList() {
        return deviceList;
    }

    public void setDeviceList(List<Device> deviceList) {
        this.deviceList = deviceList;
    }
}
